<?php

namespace mpend\modules\cms\controllers;

use Yii;
use mpend\components\Controller;

/**
 * 资讯相关或推荐列表接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class RelevantController extends Controller {

    /**
     * @var \mpend\modules\cms\models\ArticleRelevantSearch 资讯检索模型
     */
    public $modelClass = 'mpend\modules\cms\models\ArticleRelevantSearch';

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * @inheritdoc
     */
    public function actionIndex($id) {
        /* @var $model \mpend\modules\cms\models\ArticleRelevantSearch */
        $model = new $this->modelClass;
        $model->id = $id;
        return $model->search();
    }

}
